<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>数据管理</title>
    <link rel="stylesheet" href="../component/pear/css/pear.css"/>
    <style>
        #queryForm {
            display: flex;
            justify-content: center;
            align-items: center;
        }

    </style>
</head>
<body class="pear-container">
<div class="layui-card">
    <div class="layui-card-body">
        <form class="layui-form" action="" id="queryForm">
            <div class="layui-form-item">
                <div class="layui-form-item layui-inline">
                    <label class="layui-form-label">Coverage Id</label>
                    <div class="layui-input-inline">
                        <input type="text" name="coverageId" placeholder="输入元数据标识" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item layui-inline">
                    <label class="layui-form-label">Subtype</label>
                    <div class="layui-input-inline">
                        <input type="text" name="subtype" placeholder="输入元数据类型" class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item layui-inline">
                    <button class="pear-btn pear-btn-md pear-btn-primary" lay-submit lay-filter="user-query">
                        <i class="layui-icon layui-icon-search"></i>
                        查询
                    </button>
                    <button type="reset" class="pear-btn pear-btn-md">
                        <i class="layui-icon layui-icon-refresh"></i>
                        重置
                    </button>
                </div>
            </div>
        </form>
    </div>
</div>
<div class="layui-card">
    <div class="layui-card-body">
        <table id="user-table" lay-filter="user-table"></table>
    </div>
</div>

<div id = "registerEdit" style="display: none;padding: 15px">
    <form class="layui-form layui-form-pane" action="" onsubmit="return false">
        <input type="hidden" name="cid" id = "cid">
        <div class="layui-form-item">
            <label class="layui-form-label">Coverage id</label>
            <div class="layui-input-block">
                <input type="text" name="coverageId" id = "coverageId" required  lay-verify="required" placeholder="请输入元数据唯一标识" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">Subtype</label>
            <div class="layui-input-block">
                <select name="subtype"  id ="subtype">
                    <option value="">请选择数据类型</option>
                    <optgroup label="ISO 19163" data-group-value = "ISO_19163">
                        <option value="CategoricalGriddedData">CategoricalGriddedData</option>
                        <option value="NumericalGriddedData">NumericalGriddedData</option>
                        <option value="FusedImage">FusedImage</option>
                        <option value="OpticalImage">OpticalImage</option>
                        <option value="RadiometerData">RadiometerData</option>
                        <option value="SARData">SARData</option>
                        <option value="SimulatedImage">SimulatedImage</option>
                    </optgroup>
                    <optgroup label="ISO 19123" data-group-value = "ISO_19123">
                        <option value="RectifiedGridCoverage">RectifiedGridCoverage</option>
                        <option value="ReferenceableGridCoverage">ReferenceableGridCoverage</option>
                    </optgroup>
                </select>
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">Description</label>
            <div class="layui-input-block">
                            <textarea name="description" id="description" placeholder="请输入元数据描述"
                                      class="layui-textarea"></textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="editSubmit">提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
</div>
<script type="text/html" id="user-toolbar">
    <button class="pear-btn pear-btn-primary pear-btn-md" lay-event="download">
        <i class="layui-icon layui-icon-download-circle"></i>
        下载
    </button>
    <button class="pear-btn pear-btn-danger pear-btn-md" lay-event="batchRemove">
        <i class="layui-icon layui-icon-delete"></i>
        删除
    </button>
</script>

<script type="text/html" id="user-bar">
    <button class="pear-btn pear-btn-primary pear-btn-sm" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>
    </button>
    <button class="pear-btn pear-btn-danger pear-btn-sm" lay-event="remove"><i class="layui-icon layui-icon-delete"></i>
    </button>
</script>


<script type="text/html" id="user-createTime">
    {{layui.util.toDateString(d.createTime, 'yyyy-MM-dd HH:mm')}}
</script>

<script type="text/html" id="validate-enable">
    <input type="checkbox" name="enable" value="{{d.cid}}" lay-skin="switch" lay-text="ON|OFF" lay-filter="validate-enable" {{ d.validate == 1 ? 'checked' : '' }} />
</script>

<script src="../component/layui/layui.js"></script>
<script src="../component/pear/pear.js"></script>
<script src="../js/dataManagement.js"></script>
</body>
</html>